import sys

from PyQt4.QtCore import *
from PyQt4.QtGui import *

app = QApplication(sys.argv)

l = QLineEdit(None)
v = QRegExpValidator(l)
v.setRegExp(QRegExp("[A-Z|a-z|0-9|@|\.]+"))
l.setValidator(v)
l.show()

app.exec_()